﻿using Domain.Entity;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Infrastructure.Config
{
    public class UserLoginHistoryConfig : IEntityTypeConfiguration<UserLoginHistory>
    {
        public void Configure(EntityTypeBuilder<UserLoginHistory> builder)
        {
           builder.ToTable("UserLoginHistories");
            builder.OwnsOne(u => u.Phone, pn => {
                pn.Property(p => p.RegionCode).HasMaxLength(63).IsUnicode(false);
                pn.Property(p => p.Number).HasMaxLength(31).IsUnicode(false);
            });
        }
    }
}
